Okay, you've got a directory full of files, and you want to do the same operation to each of them. Some examples might be: > Editing a number of textfiles, then doing something to each of them after you're through, such as renaming them or copying a duplicate to a different directory. > Compressing a number of files to individual LZX files. > Converting other archives to LZX, the first of the "smart" archivers. > Adding a ReadMe file or something to a number of LZX files. Really, any operation that you can list out as a standard Execute scriptfile, but this will allow you to do it to a large random number of files, rather than some specified list. Let's take an easy example: Let's say we have a bunch of pictures we want to compress to individual LZX files. They're in our dh0:Files directory. Smart DOS uses the List command to list out the Files directory, and the "LFORMAT" option lists out a separate command line for each one. The "" wildcard will be the name of the next file on the list. If we were making an Execute scriptfile, planning on doing this to just ONE file, it would look something like the following. This could be done better, but for this example we'll just take it step-by-step: MakeDir Ram:Temp ;we'll do all the work here CD Ram:Temp Copy dh0:Files/ Ram:Temp ;copies the file to Ram:Temp LZX a ;compresses the file to .LZX Copy .LZX dh0:Files ;copies new LZX file back to hard drive Delete #? ;deletes files in work area Okay, with me so far? Now check out the following. To note is that the Echo line is ONE line with your text editor, although it'll break into two lines here. This is a scriptfile that you Execute: ---------------------- .k dev ;don't put anything above these four lines .def dev "Ram:" .bra { .ket } MakeDir Ram:Temp CD Ram:Temp List >Ram:x1 dh0:Files nohead quick LFORMAT "Execute Ram:x2 %s %s" Echo >Ram:x2 ".k path,name*nCopy dh0:Files/ Ram:Temp*nLZX a *n- Copy .LZX dh0:Files*nDelete #?" Execute Ram:x1 ;this is what actually does the work --------------------------- Okay, you can kinda see what that did. It listed out the files in dh0:Files, it kept the list `clean' with nohead and quick, and the LFORMAT puts the Echo line before each entry, with the whole mess being outputted to a scriptfile in Ram called x1 which is then Executed to do the actual work. The Echo command is ONE line, remember. It should basically be what we had listed up above, with the little "*n" jobbies in between each command. I guess the line can be as long as 255 characters, the max width of a DOS line. If you need it to be longer, I suppose you'd Execute sub-scriptfiles. Whether or not the sub-scripts would understand the "" wildcard, I don't know. But they "should". The next improvement we make is using some generic directory heading for the directory the files are in, like "XXX:". We "Assign dh0:Files: XXX:" before running the scriptfile. This way we don't have to keep altering the file. If the next directory of files to be worked on is "dh0:Files2", then just Assign that to "XXX:" before Executing the file again. So now it looks like this: List >Ram:x1 XXX: nohead quick LFORMAT "Execute Ram:x2 %s %s" Echo >Ram:x2 ".k path,name*nCopy XXX: Ram:Temp*nLZX a *n- Copy .LZX XXX:*nDelete #?" That does the same thing as our original example, only now we can leave the scriptfile alone and just Assign whatever dir that needs work to "XXX:". Following is an example of how to use sub-directories in all this, like if you're LZX'ing directories and sub-directories. This converted my LHA files to LZX. The LHA archives are in "XXX:", the path for the new LZX files is "YYY:". Note: I use the old arp version of Copy as it handles wildcards better. First, let's list them out so it'll look understandable: LHA x XXX: ; extracts files from archive LZX -3 -m -r -x -e -Y a #? ; LZX does its thing copy #?.LHA.LZX YYY:#?.LZX ; copies new LZX file to YYY: delete #? all" ; deletes everything in work area What you're noting are the "" commands, the extended string for LZX, the "all" in "delete all" (to get any sub-dirs), and how "" is going to be something like "BOOBIES.LHA", so when you LZX the "", the LZX filename is going to be "BOOBIES.LHA.LZX". That's why the odd look to the copy command. You can try your own Copy command, just keep the arp one in mind if it doesn't work. I also use the arp Rename command as a general rule. In clever SmartDOS, that'd be: List >Ram:x1 XXX: nohead quick lformat "execute Ram:x2 %s %s" Echo >Ram:x2 ".k path,name*nLHA x XXX:*nLZX -3 -m -r -x -e -Y a #?*ncopy #?.LHA.LZX YYY:#?.LZX*n delete #? all" Basically, once you get it going for one operation, you just keep a Master kicking around somewhere, and when you want to do something different in the future, just plug in the different pathnames and commands. I just used one the other day where I had it Executing a FakeKey/MovePointer file in each go- around, converting my file descriptions to file_id.diz files, pretty cool. - TBM